package org.csu.mypetstore.controller;

//import org.csu.mypetstore.domain;
import org.csu.mypetstore.service.SearchService;
import org.csu.mypetstore.domain.SearchVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/catalog/view")
public class SearchController {

    @Autowired
    private SearchService searchService;

    @GetMapping("/search/suggest")
    public List<SearchVo> searchSuggestions(@RequestParam String keyword) {
        return searchService.fuzzySearch(keyword);
    }

}
